package com.fjec.market.feign;

import com.fjec.market.feign.config.FeignConfig;
import com.fjec.market.feign.fallback.ActivityClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

//@FeignClient(name = "activity-serv", fallback = ActivityClientFallback.class, configuration = FeignConfig.class)
@FeignClient(name = "activity-serv")
public interface ActivityClient {
    @RequestMapping(method = RequestMethod.GET, value = "/api/seckill/hasSeckillOrGiving")
    Integer hasSeckillOrGiving(@RequestParam("userId") Long userId,
                               @RequestParam("busiType") Integer busiType,
                               @RequestParam("busiId") Long busiId);

    @RequestMapping(method = RequestMethod.POST, value = "/api/put/user/gifts")
    int putUserGifts(@RequestBody List<Map<String, Object>> boughtGifts, @RequestParam("orderId") Long orderId);
}
